package org.jeecg.modules.jxc.inventorymanagement.commodityloss.controller;

import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.jxc.homepage.entity.JxcGoods;
import org.jeecg.modules.jxc.homepage.service.IJxcGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @description:
 * @company: yaorange
 * @author: Mr.Sun
 * @version: 1.0
 * @create: 2021-12-22 15:31:06
 */
@Api(tags = "jxc_stock_limit")
@RestController
@RequestMapping("/goods")
@Slf4j
public class StockLimitController {
    @Autowired
    private IJxcGoodsService jxcGoodsService;

    /**
     * 请求URL：http://localhost:8080/jeecg-boot/goods/listAlarm2
     * 请求参数：无
     * 请求方式：POST
     * 返回值类型：JSON
     * 返回值：Map<String,Object>
     */
    @PostMapping("/listAlarm2")
    public Map<String, JxcGoods> queryStockLimit(){
        Map<String, JxcGoods> jxcGoodsList = jxcGoodsService.findStockLimit();
        for (Map.Entry<String,JxcGoods> entry : jxcGoodsList.entrySet())
            System.out.println(entry.getKey()+":====="+entry.getValue());
//        System.out.println(jxcGoodsList);
        return jxcGoodsList;
    }
}
